<link rel="stylesheet" type="text/css" href="/static/admin/css/admin.css" />
<style>
    .layuimini-notice:hover {background:#f6f6f6;}
    .layuimini-notice {clear:both;font-size:12px !important;cursor:pointer;position:relative;transition:background 0.2s ease-in-out;}
    .layuimini-notice-title,.layuimini-notice-label {
        padding-right: 70px !important;text-overflow:ellipsis!important;overflow:hidden!important;white-space:nowrap!important;}
    .layuimini-notice-title {line-height:28px;font-size:14px;}
    .layuimini-notice-extra {position:absolute;top:50%;margin-top:-8px;right:16px;display:inline-block;height:16px;color:#999;}
    #jxphb tbody tr:nth-child(2){background:#ffcc99;}
    #jxphb tbody tr:nth-child(3){background:#ccccff;}
    #jxphb tbody tr:nth-child(4){background:#ffcccc;}
</style>
<div class="layuimini-container">
    <div class="layuimini-main">
    
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">
            <div class="layui-row layui-col-space15">
               <!-- <div class="layui-col-xs12 layui-col-sm6 layui-col-md6 layui-col-lg6">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            我的线索数
                            &lt;!&ndash; <span class="layui-badge layui-bg-blue layuiadmin-badge">周</span> &ndash;&gt;
                        </div>
                        <div class="layui-card-body layuiadmin-card-list">
                            <p class="layuiadmin-big-font">{$cluesCount_week}</p>
                            <p>
                                总线索
                                <span class="layuiadmin-span-color">{$cluesCount} 条</span>
                            </p>
                        </div>
                    </div>
                </div>-->

                <div class="layui-col-xs12 layui-col-sm6 layui-col-md6 layui-col-lg6">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            公海
                        </div>
                        <div class="layui-card-body layuiadmin-card-list">

                            <p class="layuiadmin-big-font">{$liberumCount}</p>
                            <p>
                                总数据
                                <span class="layuiadmin-span-color">{$liberumCount} 条</span>
                            </p>
                        </div>
                    </div>
                </div>

                <div class="layui-col-xs12 layui-col-sm6 layui-col-md6 layui-col-lg6">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            我的客户
                            <!-- <span class="layui-badge layui-bg-cyan layuiadmin-badge">月</span> -->
                        </div>
                        <div class="layui-card-body layuiadmin-card-list">
                            <p class="layuiadmin-big-font">{$clientCount_month}</p>
                            <p>
                                总客户
                                <span class="layuiadmin-span-color">{$clientCount} 个</span>
                            </p>
                        </div>
                    </div>
                </div>

                <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg12">
                    <div class="layui-card">
                        <div class="layui-card-header">绩效月排行 <a href="javascript:;" style="float: right;" layuimini-content-href="/admin/order/analytics.html" data-title="业绩统计" data-icon="fa fa-university">更多>></a></div>
                        <div class="layui-card-body" style="overflow-y: scroll;">
                            <table class="layui-table" id="jxphb">
                                <tbody>
                                <tr>
                                    <td>月度排名</td>
                                    <td>业务员</td>
                                    <td>月目标（元）</td>
                                    <td>已成交（元）</td>
                                    <td>回款（元）</td>
                                    <td>完成率（%）</td>
                                    <td>已成交（单）</td>
                                    <td>提成点（%）</td>
                                </tr>
                                {volist name='userlist' id='vo' key="k" }
                                <tr >
                                    <?php
if($vo['money_month']){
$vo['wanchenglv']=round($vo['money_month']/$vo['mubiao']*100,2);
}else{
$vo['wanchenglv']=$vo['money_month']=0;
}
?>
                                    <td>{$k}</td>
                                    <td>{$vo['realname']}</td>
                                    <td>{$vo['mubiao']}</td>
                                    <td>{$vo['money_month']}</td>
                                    <td>{$vo['return_money_month']|default=0}</td>
                                    <td>{$vo['wanchenglv']}</td>
                                    <td>{$vo['number_month']|default=0}</td>
                                    <td>{$vo['ticheng']}%</td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

                <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg12">
                    <div class="layui-card">
                        <div class="layui-card-header">提醒信息 <a href="javascript:;" style="float: right;" layuimini-content-href="/admin/process.todo/index.html" data-title="提醒信息" data-icon="fa fa-commenting">更多>></a></div>
                        <div class="layui-card-body">
                            <?php
$aid=$admin['admin_id'];

$group_id=\think\facade\Db::name('admin')->where('admin_id',$aid)->cache('group_id_'.$aid)->value('group_id');
                            $todoLst=\think\facade\Db::name('ymwl_todo')->whereRaw('`admin_id` = :aid OR FIND_IN_SET(:group_id,`show_auth_group_id`)',['aid'=>$aid,'group_id'=>$group_id])->order('createtime DESC')->select();
                            foreach($todoLst as $v){
                            ?>
                            <div class="layuimini-notice" <?php if(strpos(','.$v['show_auth_group_id'].',',','.$group_id.',')!==false && $v['is_finish']==0){ ?>data-open="{$v['url']}&tudo_id={$v['id']}" <?php } ?> data-title="{$v['title']}">
                            <div class="layuimini-notice-title">【{$v['title']}】{$v['mess']} <span style="color: blue;">{$v['result']}</span></div>
                            <div class="layuimini-notice-extra">{:date('Y-m-d H:i',$v['createtime'])}</div>
                        </div>
                        <?php } ?>

                    </div>
                </div>
            </div>

            <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg12">
                <div class="layui-card">
                    <div class="layui-card-header">动态</div>
                    <div class="layui-card-body">
                        <dl class="layuiadmin-card-status">


                            {volist name='result' id='vo'}
                            <dd>
                                <div class="layui-status-img"><a href="javascript:;">
                                    <img src="{$vo.avatar}"></a>
                                </div>
                                <div>
                                    <p>{$vo.username} <em style="color: red;margin-right: 5px">跟进</em>  <a href="javascript:;" data-open="crm.record/dialogue?id={$vo.id}" data-title="最近跟进记录" data-full="true" > {$vo.name}</a> </p>
                                    <p><strong style="color: burlywood;margin-right: 5px">跟进记录: </strong>{$vo.content}</p>
                                    <span>跟进时间：{$vo.create_time|date='Y-m-d H:i:s'}</span>
                                </div>
                            </dd>
                            {/volist}

                        </dl>
                    </div>
                </div>
            </div>


            </div>

        </div>

        <div class="layui-col-md4">
            <div class="layui-row layui-col-space15">

                <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg12">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            公告
                        </div>
                        <div class="layui-card-body layuiadmin-card-list">

                            <p>
                                {$system['notice']|raw}
                            </p>
                        </div>
                    </div>
                </div>


                <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg12">
                    <div class="layui-card">
                        <div class="layui-card-header">待办</div>
                        <div class="layui-card-body layui-text">
                            <table class="layui-table">
                                <tbody>
                                <tr>
                                    <td>今日已跟进</td>
                                    <td>
                                        {$today_followed_count}
                                    </td>
                                </tr>
                                <tr>
                                    <td>未跟进个数</td>
                                    <td>
                                        {$not_followed_count}
                                    </td>
                                </tr>
                                <tr>
                                    <td>跟进率</td>
                                    <td>
                                        {$genjinlv}%
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

                <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg12">
                    <div class="layui-card">
                        <div class="layui-card-header">跟进提醒</div>
                        <div class="layui-card-body">
                            <dl class="layuiadmin-card-status">
                                {volist name='today_tiixng' id='vo'}
                                <dd>
                                    <div>
                                        <p>{$vo.pr_user} <em style="color: red;margin-right: 5px">跟进</em>  <a href="javascript:;" data-open="crm.record/dialogue?id={$vo.id}" data-title="跟进客户" data-full="true" > {$vo.name}</a> </p>
                                        <span>下次跟进时间：{$vo.next_up_time|date='Y-m-d H:i:s'}</span>
                                    </div>
                                </dd>
                                {/volist}

                            </dl>
                        </div>
                    </div>
                </div>

            </div>
        </div>

</div>
</div>
